package com.ruoyi.controller;


import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.domain.Market;
import com.ruoyi.service.ISaleRecordService;
import com.ruoyi.system.service.impl.SysUserServiceImpl;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


/**
 * 产品可视化页面--pyd  --数据可视化
 */
@Controller
@RequestMapping("/ruoyikeshihua/market")
public class MarketController extends BaseController {
    //private String prefix = "market";
    private String prefix = "keshihua/market";
    @Resource
    private ISaleRecordService saleRecordService;
    @RequiresPermissions("system:market:view")
    @GetMapping()
    public String dept()
    {
        return prefix + "/index";
    }

    @PostMapping("/keshihuaList")
    @ResponseBody
    public Map<String, List<Market>> market() {
        Map<String,List<Market>> map=new HashMap<>();
        map.put("keshihuaList1",saleRecordService.keshihuaList1());//品牌占比
        map.put("keshihuaList2",saleRecordService.keshihuaList2());//产品类型占比
        map.put("keshihuaList3", saleRecordService.keshihuaList3());//产品类型占比
        return map;
    }
}
